<?php

/**
 * Controller is the customized base controller class.
 * All controller classes for this application should extend from this base class.
 * 
 * @author Hồ Hữu Tài <ho.huutai@gnt.com.vn>
 * @Url
 * @Update History
 *      Date(yyyy/mm/dd)  |      Editor          |      Description
 *   2011/11/29                 Hồ Hữu Tài              create new
 */
class BaseController extends CController
{

    public $layout = '//layouts/main';

    protected function beforeAction($action)
    {
        parent::beforeAction($action);
        // Check only when the user is logged in
        error_log("session:". print_r(Yii::app()->session['timeout'], TRUE));
        if (!isset(Yii::app()->session['isLogin']))
        {
            // timeout
            Yii::app()->user->logout();
        }
        else
        {
            return true;
        }

        return true;
    }

}